package com.example.listafacil.componentes;

import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnFocusChangeListener;
import android.widget.EditText;
import android.widget.GridLayout;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.Toast;

import com.example.listafacil.R;

public class MainActivity extends Activity {
	// BancoDeDados db;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		// db = new BancoDeDados(this);
		// final Button button = (Button) findViewById(R.id.button1);
		// button.setOnClickListener(new OnClickListener() {
		// @Override
		// public void onClick(View v) {
		// mostrarMensagem(v);
		// adicionarLinha(null);
		// }
		// });
		//
		// List<Map<String, String>> listaSalva = listaSalva();
		// for (Map<String, String> map : listaSalva) {
		// adicionarLinha(map);
		// }

	}

	private void adicionarLinha(Map<String, String> valores) {

		GridLayout grid = (GridLayout) findViewById(R.id.grid);
//		grid.addView(linha);

	}

	public void mostrarMensagem(View v) {
		Toast toast = Toast.makeText(this, "linha adicionada", Toast.LENGTH_SHORT);
		toast.show();
	}

	private List<Map<String, String>> listaSalva() {
		// return db.recuperarLista();
		return null;
	}

	@Override
	protected void onDestroy() {
		// db.close();
		super.onDestroy();
	}
}
